import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'

// https://vitejs.dev/config/
export default defineConfig({
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src'),
            view: path.resolve(__dirname, 'src/view'),
            page: path.resolve(__dirname, 'src/page'),
            router: path.resolve(__dirname, 'src/router'),
            plugin: path.resolve(__dirname, 'src/plugin'),
            util: path.resolve(__dirname, 'src/util'),
        },
    },
    plugins: [
        vue({
            template: { transformAssetUrls },
        }),
        quasar(),
    ],
    server: {
        proxy: {
            '/api': {
                target: 'http://localhost:8080/',
                ws: true,
                changeOrigin: true,
            },
        },
    },
})
